import Cookies from 'js-cookie'

const baseCookie = "history_mobile"
const tokenKey = `${baseCookie}token`
const acountKey = `${baseCookie}account`
const nameKey = `${baseCookie}name`
const uidKey = `${baseCookie}uid`

export function getToken() {
  return Cookies.get(tokenKey)
}

export function setToken(token) {
  return Cookies.set(tokenKey, token, { expires: 1 })
}

export function removeToken() {
  return Cookies.remove(tokenKey)
}

export function getAccount() {
  return Cookies.get(acountKey)
}

export function setAccount(account) {
  return Cookies.set(acountKey, account, { expires: 1 })
}

export function removeAccount() {
  return Cookies.remove(acountKey)
}

export function getName() {
  return Cookies.get(nameKey)
}

export function setName(name) {
  return Cookies.set(nameKey, name, { expires: 1 })
}

export function removeName() {
  return Cookies.remove(nameKey)
}

export function getUid() {
  return Cookies.get(uidKey)
}

export function setUid(uid) {
  return Cookies.set(uidKey, uid, { expires: 1 })
}

export function removeUid() {
  return Cookies.remove(uidKey)
}
